package com.pilot.game.repository;

import com.pilot.game.domain.Agency;
import org.springframework.stereotype.Repository;

import org.springframework.data.jpa.repository.*;


/**
 * Spring Data JPA repository for the Agency entity.
 */
@SuppressWarnings("unused")
@Repository
public interface AgencyRepository extends JpaRepository<Agency, Long> {

    Agency findByAccountNameAndPassword(String accountName, String password);

    Agency findByAccountName(String accountName);

    @Query("select sum(u.limit) from Agency u where u.father = ?1")
    int findSumAgencyByFather(String father);
}
